package com.itheima.reggie.common;

/**
 * 基于ThreadLocal封装工具类，用户保存和获取当前登录用户id
 */
public class BaseThreadLocal {
    private static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<>();
    public static void set(Long id){
        THREAD_LOCAL.set(id);
    }
    public static Long get(){
        return  THREAD_LOCAL.get();
    }
    public static void remove(){
        THREAD_LOCAL.remove();
    }
}
